package com.zhc.dejingapi.controller;


import com.github.pagehelper.PageInfo;
import com.zhc.dejingapi.common.result.Result;
import com.zhc.dejingapi.entity.QingBoilingreportEntity;
import com.zhc.dejingapi.entity.query.CodeQuery;
import com.zhc.dejingapi.entity.vo.QingInjectAndSendWorkVo;
import com.zhc.dejingapi.service.QingBoilingreportService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * 水处理派工单 前端控制器
 * </p>
 *
 * @author zhc
 * @since 2024-10-16
 */
@RestController
@RequestMapping("/qing-boilingreport")
@CrossOrigin
public class QingBoilingreportController {

    @Resource
    private QingBoilingreportService qingBoilingreportService;

    @PostMapping("/reportFinishBoilJob")
    public Result reportBoilJob(@RequestBody QingInjectAndSendWorkVo qingInjectAndSendWorkVo){
        return qingBoilingreportService.reportBoilJob(qingInjectAndSendWorkVo);
    }

    @PostMapping("/getReportFinishBoil")
    public Map<Object, Object> getReportFinishBoil(@RequestBody CodeQuery codeQuery){
        PageInfo<QingBoilingreportEntity> page=qingBoilingreportService.getReportFinishBoil(codeQuery);
        Map<Object, Object> map = new HashMap<>();
        map.put("records",page.getList());
        map.put("total",page.getTotal());
        return  map;

    }
}
